<template>
  <uvImage
      :bgColor="bgColor"
      :customStyle="customStyle"
      :duration="duration"
      :errorIcon="errorIcon"
      :fade="fade"
      :height="height"
      :lazyLoad="lazyLoad"
      :loadingIcon="loadingIcon"
      :mode="mode"
      :radius="radius"
      :shape="shape"
      :showError="showError"
      :showLoading="showLoading"
      :showMenuByLongpress="showMenuByLongpress"
      :src="src"
      :webp="webp"
      :width="width"
      @click="$emit('click')"
      @error="$emit('error')"
      @load="$emit('load')"
  >
    <template v-slot:loading>
      <slot name="loading"></slot>
    </template>
    <template v-slot:error>
      <slot name="error"></slot>
    </template>
  </uvImage>
</template>

<script>
/**
 * 此组件存在的理由是，在nvue下，u-image被uni-app官方占用了，u-image在nvue中相当于image组件
 * 所以在nvue下，取名为u--image，内部其实还是u-iamge.vue，只不过做一层中转
 */
import uvImage from '../u-image/u-image.vue';
import props from '../u-image/props.js';

export default {
  name: 'u--image',
  mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
  components: {
    uvImage
  },
}
</script>